package com.nuanshui.heatedloan.userinfo.service;

import com.nuanshui.framework.consts.TransactionManagerType;
import com.nuanshui.heatedloan.userinfo.dal.mapper.UserInviteFriendMapper;
import com.nuanshui.heatedloan.userinfo.facade.UserInviteFriendService;
import com.nuanshui.heatedloan.userinfo.tool.UserTool;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
@Transactional(readOnly=true,value=TransactionManagerType.USER_INFO_TRANSACTION_MANAGER)
public class UserInviteFriendServiceImpl  implements UserInviteFriendService {

	@Autowired
	private UserInviteFriendMapper userInviteFriendMapper;

	@Autowired
	private UserTool userTool;

	@Override
	public Long loadNotExchangeFriendCount(String userId) {
		return userInviteFriendMapper.loadNotExchangeFriendCount(userId);
	}

	@Override
	@Transactional(value=TransactionManagerType.USER_INFO_TRANSACTION_MANAGER)
	public void saveInviteFriend(String sourceUserId, String targetUserId) {

		userInviteFriendMapper.saveInviteFriend(sourceUserId, targetUserId);
	}
}
